from pyspark.sql import SparkSession

if __name__ == '__main__':
    spark = SparkSession.builder. \
        appName("test"). \
        master("local[*]"). \
        config("spark.sql.shuffle.partitions", 3). \
        config("spark.sql.warehouse.dir", "hdfs://laoban-test/user/hive/warehouse"). \
        config("hive.metastore.uris", "thrift://11.50.138.181:9083,thrift://11.50.138.179:9083"). \
        enableHiveSupport(). \
        getOrCreate()

    sc = spark.sparkContext

    spark.sql("show databases").show()
